package com.itlong.cloud.user.smartcard;

import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldDeviceInfoDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldGetDevicesPageDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldUpdateDeviceInfoDTO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardOldDeviceInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      旧一卡通_设备模块更新楼层对应表暴露接口。
 * <desc/>
 *
 * @createDate 2017/11/22.
 */
@FeignClient(name="equip-service")
public interface ISmartCardOldDeviceServiceClient {

     /**
      * <desc>
      *      更新楼层对应表。
      * <desc/>
      *
      * @param  saveDTO 请求参数
      * @return 返回影响行数
      * @author shengen.T
      * @createDate 2017/11/22
      */
    @RequestMapping(path = "/device/deviceInfo/manage/editFloorConfig",method = RequestMethod.POST)
    Integer updateFloorConfig(@RequestBody SmartCardOldDeviceInfoDTO saveDTO) throws Exception;

    /**
     * <desc>
     *      获取某项目中的设备唯一码列表
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceType 设备类型：1-电梯，2-门禁
     * @return
     * @author Chunjian.G
     * @createDate 2017-12-15
     */
    @RequestMapping(path = "/device/deviceInfo/manage/getDeviceUniques",method = RequestMethod.POST)
    List<String> getDeviceUniques(@RequestParam("projectId") String projectId,
                                  @RequestParam("deviceType") Integer deviceType) throws Exception;

    /**
     * <desc>
     *      添加默认设备信息
     * <desc/>
     *
     * @param deviceUniques 设备唯一码列表
     * @param deviceType 设备类型：1-电梯，2-门禁
     * @param projectId 项目编号
     * @return
     * @author Chunjian.G
     * @createDate 2017-12-15
     */
    @RequestMapping(path = "/device/deviceInfo/manage/addDefaultDevices",method = RequestMethod.POST)
    Integer addDefaultDevices(@RequestBody List<String> deviceUniques,
                              @RequestParam("deviceType") Integer deviceType,
                              @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     *      旧_一卡通获取设备列表。
     * <desc/>
     *
     * @param  pageDTO
     * @return
     * @author shengen.T
     * @createDate 2017-12-05
     */
    @RequestMapping(path = "/device/deviceInfo/manage/list",method = RequestMethod.POST)
    Page<SmartCardOldDeviceInfoVO> getDevicePage(SmartCardOldGetDevicesPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      旧_一卡通更新设备信息。
     * <desc/>
     *
     * @param updateDTO 更新设备信息参数
     * @return
     * @author shengen.T
     * @createDate 2017-12-12
     */
    @RequestMapping(path = "/device/deviceInfo/manage/updateDevice",method = RequestMethod.POST)
    boolean updateDeviceInfo(@RequestBody SmartCardOldUpdateDeviceInfoDTO updateDTO) throws Exception;


    /**
     * <desc>
     *      旧一卡通_添加设备。
     * <desc/>
     *
     * @param  deviceInfo 设备信息
     * @return
     * @author shengen.T
     * @createDate 2017-12-12
     */
    @RequestMapping(path = "/device/deviceInfo/manage/addDevice",method = RequestMethod.POST)
    boolean addDeviceInfo(@RequestBody SmartCardOldUpdateDeviceInfoDTO deviceInfo) throws Exception;
}
